package cn.zero.flowspringbootstater.modular.bean;

import cn.zero.flowspringbootstater.constant.HttpStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

/**
 * 通用异常类
 *
 * @author liaotian
 * @date 2021/9/18 11:05
 */
@Data
@RequiredArgsConstructor
@AllArgsConstructor
public class GeneralException extends RuntimeException{

    @NonNull
    private Integer code;

    private String message;


    public GeneralException(String message)
    {
        super(message);
        this.message = message;
        this.code = HttpStatus.ERROR;
    }
}
